<!-- Inicio Codigo feo para FB-->
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/es_LA/all.js#xfbml=1&appId=151090545023142";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<%# ruta_root = "http://pukara.ya.st"%>
<% ruta_root = "http://200.16.7.111"%>
<% ruta = ruta_root+'/cultural_heritage/cultural_institutions/'+@cultural_heritage_cultural_institution.id.to_s %>
<% titulo= '<meta property="og:title" content="[Pukara] '+@cultural_heritage_cultural_institution.name+'" >'%>
<%=  content_for(:title) {
  titulo.html_safe
  } %>
<% url= '<meta property="og:url" content="'+ruta+'">'%>
<%=  content_for(:url) {
  url.html_safe
} %>
<%=  content_for(:type) {
  '<meta property="og:type" content="article">'.html_safe
} %>
<%imagen = '<meta property="og:image" content="'+ruta_root+'/images/pukara_logo2.png">'%>
<%=  content_for(:image) {
  imagen.html_safe
} %>
<%=  content_for(:site_map) {
  '<meta property="og:site_name" content="Pukara">'.html_safe
} %>
<!-- Fin Codigo feo para FB-->
<!-- Inicio codigo para el Google MAPS -->
<%= stylesheet_link_tag 'gmaps4rails' %>
<!-- Fin codigo para el Google MAPS -->
<h1>Mostrar Institución Cultural (<%= @cultural_heritage_cultural_institution.name %>)</h1>
<p id="notice"><%= notice %></p>
<div class="shadow">
  <fieldset class="column-left4">
    <fieldset id="agrupacion" >
    <legend>Datos Básicos </legend>
        <fieldset class="column-left">
        <% if ! @cultural_heritage_cultural_institution.name.blank? %>
        <p>
          <b>Nombre:</b>
          <%= @cultural_heritage_cultural_institution.name %>
        </p>
        <%end%>
        <% if ! @cultural_heritage_cultural_institution.description.blank? %>
        <p>
          <b>Descripción:</b>
          <%= @cultural_heritage_cultural_institution.description %>
        </p>
        <%end%>
        </fieldset>
        <% if ! @cultural_heritage_cultural_institution.avatar_file_name.blank? %>
        <fieldset class="column-right4" id="agrupacion" >
          <legend>Foto:</legend>
          <div <%if @cultural_heritage_cultural_institution.avatar_file_name.blank? %> style="display:none"<%end%>>
        <p>

          <%cultural_heritage_cultural_institution_avatar=@cultural_heritage_cultural_institution%>
          <a href=<%=cultural_heritage_cultural_institution_avatar.avatar.url%> rel="lightbox[roadtrip]" title=<%=cultural_heritage_cultural_institution_avatar.name%>><img src=<%=cultural_heritage_cultural_institution_avatar.avatar.url%> width="100" height="100" /></a>

        </p>
          </div>
        </fieldset>
        <%end%>                
    </fieldset>
    <% if ! (@cultural_heritage_cultural_institution.email.blank? and   @cultural_heritage_cultural_institution.phone.blank? and  @cultural_heritage_cultural_institution.web.blank?) %>
        <fieldset id="agrupacion" >
        <legend>Datos Adicionales </legend>
        <% if ! @cultural_heritage_cultural_institution.email.blank? %>
        <p>
          <b>Correo:</b>
          <A HREF="mailto:<%= @cultural_heritage_cultural_institution.email %>"><%= @cultural_heritage_cultural_institution.email %></A>
        </p>
        <%end%>

        <% if ! @cultural_heritage_cultural_institution.phone.blank? %>
        <p>
          <b>Teléfono:</b>
          <%= @cultural_heritage_cultural_institution.phone %>
        </p>
        <%end%>

        <% if ! @cultural_heritage_cultural_institution.web.blank? %>
        <p>
          <b>Web:</b>
          <a href="<%=@cultural_heritage_cultural_institution.web%>" target="_blank"><%=@cultural_heritage_cultural_institution.web%></a>
        </p>
        <%end%>
        </fieldset>
    <%end%>  
</fieldset>
<fieldset class="column-right4">
    <fieldset id="agrupacion" width="200">
      <legend>Compartir</legend>
      <div class="fb-like" data-href="<%=ruta%>" data-send="false" data-layout="box_count" data-width="50" data-show-faces="false"></div>
      <br/><br/>
      <% l_url = litle_url(ruta)%>
      <a href="https://twitter.com/share" class="twitter-share-button" data-url="<%= l_url  %>" data-text="Sistema de Gestion de la Cultura Peruana Pukara" data-lang="es" data-hashtags="Pukara">Twittear</a>
      <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
      <br/><br/>
      <!-- Place this tag where you want the +1 button to render -->
      <g:plusone size="small"></g:plusone>
      <!-- Place this render call where appropriate -->
      <script type="text/javascript">
      window.___gcfg = {lang: 'es-419'};

      (function() {
        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        po.src = 'https://apis.google.com/js/plusone.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
      })();
      </script>
    </fieldset>
  </fieldset>
  <div id="lineaform"></div>
  <fieldset id="agrupacion" >
    <legend>Patrimonios por Institucion Cultural </legend>
    <% if (!(@cultural_heritage_cultural_institution.list_cultural_heritage.blank?) and @cultural_heritage_cultural_institution.test_list) %>
    <table class="paginated_table sorted_table" >
      <thead>
      <tr>
        <th>Nombre</th>
        <th>Grupo</th>
        <th>Sub Grupo</th>
      </tr>
    </thead>
    <tbody>
    <% @cultural_heritage_cultural_institution.list_cultural_heritage.each do |cultural_heritage| %>
      <%if cultural_heritage.typeCulturalInstitution == 1%>
      <tr>
        <td>
          <%if cultural_heritage.group == 1%>
           <%= link_to cultural_heritage.name_code,{:controller=>"/cultural_heritage/cultural_heritages",:action => 'show',:id => cultural_heritage.id},:title => cultural_heritage.description %>
          <%else%>
           <%= link_to cultural_heritage.name_code,{:controller=>"/cultural_heritage/cultural_heritage_properties",:action => 'show',:id => cultural_heritage.id},:title => cultural_heritage.description %>
          <%end%>
        </td>
        <td><%= cultural_heritage.obj_group.name %></td>
        <td><%= cultural_heritage.obj_subGroup.name %></td>
      </tr>
      <%end%>
    <% end %>
    </tbody>
    </table>
    <% else %>
        <p> Ningún registro encontrado</p>
    <% end %>
  </fieldset>
<div id="lineaform"></div>
<%if (@cultural_heritage_cultural_institution.gmaps == true) or !(@cultural_heritage_cultural_institution.address.blank? and @cultural_heritage_cultural_institution.department.blank? and  @cultural_heritage_cultural_institution.province.blank? and  @cultural_heritage_cultural_institution.district.blank?) %>
<fieldset id="agrupacion">
  <legend>Ubicación</legend>
  <%if (@cultural_heritage_cultural_institution.gmaps == true) %>
  <%= gmaps({
      "map_options" => { "type" => "HYBRID", "center_longitude" => 180, "zoom" => 7, "auto_adjust" => true},
      "markers"     => { "data" => @json,
                         "options" => {"list_container" => "markers_list" }
                        }


    })%>
  <ul id="markers_list">  </ul>
  <%end%>
  <fieldset class="column-left">
  <% if ! @cultural_heritage_cultural_institution.department.blank? %>
  <p>
    <b>Departamento:</b>
    <%= link_to @cultural_heritage_cultural_institution.obj_department.name,{:controller=>"/shared/departments",:action => 'show',:id => @cultural_heritage_cultural_institution.department},:title => @cultural_heritage_cultural_institution.obj_department.name %>    
  </p>
  <%end%>

  <% if ! @cultural_heritage_cultural_institution.province.blank? %>
  <p>
    <b>Provincia:</b>
    <%= link_to @cultural_heritage_cultural_institution.obj_province.name,{:controller=>"/shared/provinces",:action => 'show',:id => @cultural_heritage_cultural_institution.province},:title => @cultural_heritage_cultural_institution.obj_province.name %>
    <%#= @cultural_heritage_cultural_institution.obj_province.name %>
  </p>
  <%end%>

  <% if ! @cultural_heritage_cultural_institution.district.blank? %>
  <p>
    <b>Distrito:</b>
    <%= link_to @cultural_heritage_cultural_institution.obj_district.name,{:controller=>"/shared/districts",:action => 'show',:id => @cultural_heritage_cultural_institution.district},:title => @cultural_heritage_cultural_institution.obj_district.name %>
    <%#= @cultural_heritage_cultural_institution.obj_district.name %>
  </p>
  <%end%>
  </fieldset>
  <fieldset class="column-right">
  <% if ! @cultural_heritage_cultural_institution.address.blank? %>
    <p>
      <b>Dirección:</b>
      <%= @cultural_heritage_cultural_institution.address %>
    </p>
  <%end%>
  </fieldset>
</fieldset>
<%end%>
<div id="lineaform"></div>
<!-- Facebook Inicia aqui -->
<div class="fb-comments" data-href="<%=ruta%>" data-num-posts="4" data-width="470"></div>
<div id="lineaform"></div>
</div>
<% if (user_signed_in? && ([2].include?(current_user.role))) %>
<%= link_to 'Editar', edit_cultural_heritage_cultural_institution_path(@cultural_heritage_cultural_institution) %> |
<%end%>
<%= link_to 'Regresar', cultural_heritage_cultural_institutions_path %>
